public class TestDemo2 {
    int[] a = {1,2,3,4,5};
    int[] b = new int[5];
    public void copy1(int[] a){
        for (int i = 0; i < a.length; i++) {
            b[i] = a[i];
        }
        for (int k : b){
            System.out.print(k + " ");
        }
        System.out.println();
    }
    public int[] copy2(){
        for (int i = 0; i < a.length; i++) {
            b[i] = a[i];
        }
        return b;
    }
}